home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / ShareMailGiftware / AmigaTalk / testfiles / TestDBase2 < prev    next >
Text File  |  2002-10-27  |  2KB  |  39 lines

  1. addrBook open: 'SimpleAddressBook' for: record
  2.  
  3. ( 'Executing the TestDBase2 file...' ) print
  4.  
  5. atalk setIOTitle:    'DBase example Tests (continued):'
  6. atalk setIOMessage:  'Checking read:into: method...'
  7. atalk displayString: 'Now I will read in the first record you entered.'
  8.  
  9. addrBook read: 1 into: recordData
  10.  
  11. ('Retrieved DataBase Record #1:') print
  12.  
  13. nameStr <- recordData retrieveFieldAt: (record offsetAt: 1) length: (record fieldAt: 1) fieldWidth
  14. ('First Name:  ', nameStr) print
  15.  
  16. surnameStr <- recordData retrieveFieldAt: (record offsetAt: 2) length: (record fieldAt: 2) fieldWidth
  17. ('Last  Name:  ', surnameStr) print
  18.  
  19. addressStr <- recordData retrieveFieldAt: (record offsetAt: 3) length: (record fieldAt: 3) fieldWidth
  20. ('Address   :  ', addressStr) print
  21.  
  22. cityStr    <- recordData retrieveFieldAt: (record offsetAt: 4) length: (record fieldAt: 4) fieldWidth
  23. ('City/Town :  ', cityStr) print
  24.  
  25. stateStr   <- recordData retrieveFieldAt: (record offsetAt: 5) length: (record fieldAt: 5) fieldWidth
  26. ('State     :  ', stateStr) print
  27.  
  28. zipcodeStr <- recordData retrieveFieldAt: (record offsetAt: 6) length: (record fieldAt: 6) fieldWidth
  29. ('ZipCode   :  ', zipcodeStr) print
  30.  
  31. phoneStr   <- recordData retrieveFieldAt: (record offsetAt: 7) length: (record fieldAt: 7) fieldWidth
  32. ('Phone #   :  ', phoneStr) print
  33.  
  34. atalk setIOTitle: 'DBase example finished!'
  35. atalk displayString: 'The first record should now be in the Status window (Done!)'
  36.  
  37. addrBook close " Done with TestDBase2 file! "
  38.  
  39. ( 'Finished with DBase testing!!' ) print